Market Order Dialog has next controls:
Account
This is a combo box that allows selecting one of user's accounts. In initial state it is the account from selected row in table of Accounts window. If there is no selected row, it is first account in table. There're all accounts in popup list. If there're accounts under margin call, their ids are shown with Gray foreground color. If such account is selected, text of combo box is shown with Gray foreground color too. Also the button OK becomes disabled. When account not under margin call is selected, text of combo box is shown with Black foreground color. Also the button OK becomes enabled if others controls permit that and the dialog is not disabled consider application state.
Currency
This is a combo box that allows selecting one of currency pair. In initial state it is the currency from selected row in table of Dealing Rates window. If there is no selected row, it is currency of first row in table. There're all currencies in popup list. If there're not tradable currencies, their titles are shown with Gray foreground color. If such currency is selected, text of combo box is shown with Gray foreground color too. Also the button OK becomes disabled. When tradable currency is selected, text of combo box is shown with Black foreground color. Also the button OK becomes enabled if others controls permit that and the dialog is not disabled consider application state.
Side
This is a combo box that allows selecting one of two operation Sides: BUY and SELL. In initial state it depends how action is performed, which have shown dialog. If action not specifies Side it is BUY side
Amount
This is a combo box that allows selecting how many lots (contract size) will be amount of order. In initial state it is the lot size for currency specified for Currency combo box. There're ten amounts in popup list, which ones are calculated from 1 lot to 10 lots with step in 1 lot. User can edit selected value manually but he can't input value is not divisible by lot.
Rate
This is not editable text field that shows price of selected currency. The value of field is changed when price of selected currency is changed or currency is changed or side is changed.
There're two buttons:
Ok
Is disabled in next cases:
When the button is pressed the Market Order is created and transmitted to server. But dialog has closed immediately after button is clicked.
As soon as server has admitted order, the order appears in table of Orders window with "Executing" state for short time. As soon as server opens position by that order, the order is removed from table of Orders window and open position is added to table of Open position window.
Cancel
Just hides Market Order dialog.